package com.geekarchitect.patterns.visitor.geek.v4;

import com.geekarchitect.patterns.visitor.geek.v4.impl.PPTExtractor;
import com.geekarchitect.patterns.visitor.geek.v4.impl.PdfExtractor;
import com.geekarchitect.patterns.visitor.geek.v4.impl.WordExtractor;

import java.util.HashMap;
import java.util.Map;

/**
 * @author Hongliang Zhu
 * @create 2023-01-07 22:24
 */
public class ExtractorFactory {
    private static final Map<ResourceFileType, Extractor> extractors = new HashMap<>();

    static {
        extractors.put(ResourceFileType.PDF, new PdfExtractor());
        extractors.put(ResourceFileType.PPT, new PPTExtractor());
        extractors.put(ResourceFileType.WORD, new WordExtractor());
    }

    public static Extractor getExtractor(ResourceFileType type) {
        return extractors.get(type);
    }
}
